<template>
  <div v-if="hasPermission(['system:user:add'])">
    <el-button type="primary">添加用户</el-button>
  </div>
</template>

<script>
import { mapState } from 'vuex'

export default {
  name: 'Example',
  computed: {
    ...mapState('permission', ['permissions'])
  },
  methods: {
    hasPermission(permissions) {
      return permissions.some(permission => 
        this.permissions.includes(permission)
      )
    }
  }
}
</script> 